[java bean]hibernate Session breaks a java bean?

Posted by blow on Stack Overflow See other posts from Stack Overflow or by blow
Published on 2010-06-13T07:49:29Z Indexed on 2010/06/13 7:52 UTC
Read the original article Hit count: 334

Filed under:
|
|
|
|

Hi all, i have a simple JPanel bean in my projects, now i want to drag my panel bean class into my jframe.

My panel bean class is like this:

public class BeanPanel extends javax.swing.JPanel {

/** Creates new form BeanPanel */
public BeanPanel () {
    initComponents();
    Session session=HibernateUtil.getSessionFactory().openSession();
}

This code seem to break the bean:

Session session=HibernateUtil.getSessionFactory().openSession();

When i try to drag the class into my JFrame bean i had this error message:

This component cannot be instantiated. Please make sure it is a JavaBeans Component

If i comment it all works fine. What is the reason of this?

Thanks.

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate